home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 27 / PC Gamer IT CD 27.iso / MEDIA / STORE.DXR / Internal_1.ls < prev    next >
Encoding:
Text File  |  1997-12-01  |  5.6 KB  |  206 lines

  1. on prepareMovie
  2.   repeat with theMember = 2 to 20
  3.     set i to the moviePath & the name of member theMember of castLib "dbImages" & ".pic"
  4.     set the fileName of member theMember to i
  5.     put i
  6.   end repeat
  7. end
  8.  
  9. on startMovie
  10.   global gselectedBoxes, myFile, lastFrame, originalVolume
  11.   clearGlobals()
  12.   set gselectedBoxes to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  13.   set originalVolume to the soundLevel
  14.   if originalVolume = 0 then
  15.     set originalVolume to originalVolume + 1
  16.   end if
  17.   resetBoxes()
  18.   resetFields()
  19.   set the visible of sprite 38 to 0
  20.   set the visible of sprite 52 to 0
  21.   set the visible of sprite 70 to 0
  22.   set the moveableSprite of sprite 38 to 1
  23.   if the machineType = 256 then
  24.     if the platform = "Windows,32" then
  25.       openXLib(the pathName & "XTRAS32\FileIO")
  26.     else
  27.       openXLib(the pathName & "XTRAS16\FileIO")
  28.     end if
  29.   else
  30.     openXLib(the pathName & "XTRAS:FileIOXtraFat")
  31.   end if
  32.   importData()
  33.   set the itemDelimiter to TAB
  34.   loadBrowser()
  35. end
  36.  
  37. on resetFields
  38.   set the text of field "rollover text" to EMPTY
  39.   set the text of field "roll info" to EMPTY
  40.   set the text of field "appName" to EMPTY
  41.   set the text of field "description" to EMPTY
  42.   set the text of field "launchPath" to EMPTY
  43.   set the text of field "webPath" to EMPTY
  44.   set the text of field "price" to EMPTY
  45.   set the text of field "type" to EMPTY
  46.   set the text of field "whichBox" to EMPTY
  47.   set the text of field "sign1" to EMPTY
  48.   set the text of field "sign2" to EMPTY
  49.   set the text of field "sign3" to EMPTY
  50.   set the text of field "sign4" to EMPTY
  51.   set the text of field "OsPath" to EMPTY
  52.   set the text of field "thePath" to EMPTY
  53.   set the text of field "browserSelect" to EMPTY
  54.   set the text of field "storeData" to EMPTY
  55.   set the text of field "temp" to EMPTY
  56.   set the text of field "lastClicked" to EMPTY
  57.   set the text of field "indexList" to EMPTY
  58. end
  59.  
  60. on resetBoxes
  61.   repeat with i = 2 to 21
  62.     set the visible of sprite i to 1
  63.   end repeat
  64. end
  65.  
  66. on resetDrag
  67.   set the visible of sprite 38 to 0
  68.   set the locH of sprite 38 to 296
  69.   set the locV of sprite 38 to 210
  70. end
  71.  
  72. on updateData
  73.   put item 1 of field "temp" into field "appName"
  74.   put item 2 of field "temp" into field "description"
  75.   put item 3 of field "temp" into field "launchPath"
  76.   put item 4 of field "temp" into field "webPath"
  77.   put item 5 of field "temp" into field "price"
  78.   put item 6 of field "temp" into field "platform"
  79.   put item 7 of field "temp" into field "type"
  80.   parseCRs()
  81. end
  82.  
  83. on checkItems
  84.   repeat with i = 1 to 20
  85.     set x to line i of field "storeData"
  86.     if item 1 of x = "n/a" then
  87.       set the visible of sprite (i + 1) to 0
  88.       put i + 1
  89.     end if
  90.   end repeat
  91. end
  92.  
  93. on loadBrowser
  94.   global myFile
  95.   set gOSDir to getOSDirectory()
  96.   put gOSDir & "\" into field "OSPath"
  97.   put gOSDir & "\BROWSER.TXT" into field "ThePath"
  98.   set DaPath to field "ThePath"
  99.   if objectp(myFile) then
  100.     set myFile to 0
  101.   end if
  102.   set myFile to new(xtra("fileio"))
  103.   openFile(myFile, DaPath, 1)
  104.   set TheWeb to readLine(myFile)
  105.   put TheWeb into field "browserSelect"
  106.   closeFile(myFile)
  107.   set myFile to 0
  108. end
  109.  
  110. on getDrivePC
  111.   set curpath to the moviePath
  112.   set olddelimiter to the itemDelimiter
  113.   set the itemDelimiter to "\"
  114.   set drive to item 1 of curpath & "\"
  115.   set the itemDelimiter to olddelimiter
  116.   return drive
  117. end
  118.  
  119. on getDriveMac
  120.   set curpath to the moviePath
  121.   set olddelimiter to the itemDelimiter
  122.   set the itemDelimiter to ":"
  123.   set drive to item 1 of curpath & ":"
  124.   set the itemDelimiter to olddelimiter
  125.   return drive
  126. end
  127.  
  128. on checkFile
  129.   global myFile
  130.   set myFile to new(xtra("fileio"))
  131.   set textName to the pathName & "browser.txt"
  132.   openFile(myFile, textName, 0)
  133.   if voidp(textName) then
  134.     selectWeb()
  135.   else
  136.     delete(myFile)
  137.     selectWeb()
  138.   end if
  139. end
  140.  
  141. on selectWeb
  142.   global myFile
  143.   set myFile to new(xtra("fileio"))
  144.   set fileName to displayOpen(myFile)
  145.   put fileName into field "browserSelect"
  146.   set myFile to 0
  147.   set myFile to new(xtra("fileio"))
  148.   set textName to the pathName & "browser.txt"
  149.   createFile(myFile, textName)
  150.   set vWeb to field "browserSelect"
  151.   openFile(myFile, textName, 0)
  152.   writeString(myFile, vWeb)
  153.   closeFile(myFile)
  154.   set myFile to 0
  155. end
  156.  
  157. on createIndex
  158.   global gselectedBoxes
  159.   set the text of field "indexList" to EMPTY
  160.   repeat with idx = 1 to 20
  161.     if item 1 of line idx of field "storeData" contains "n/a" then
  162.       nothing()
  163.       next repeat
  164.     end if
  165.     if field "indexList" <> EMPTY then
  166.       set i to the text of field "indexList"
  167.       put i & RETURN & item 1 of line idx of field "storeData" into field "indexList"
  168.       next repeat
  169.     end if
  170.     put item 1 of line idx of field "storeData" into field "indexList"
  171.   end repeat
  172. end
  173.  
  174. on parseCRs
  175.   set the itemDelimiter to " "
  176.   set tempStorage to EMPTY
  177.   set newString to EMPTY
  178.   repeat with x = 1 to the number of items in field "description"
  179.     set tempStorage to item x of field "description" & RETURN
  180.     set newString to newString & tempStorage
  181.   end repeat
  182.   put EMPTY into field "description"
  183.   put newString into field "description"
  184.   set the itemDelimiter to TAB
  185. end
  186.  
  187. on importData
  188.   global myFile
  189.   if the machineType = 256 then
  190.     set importPath to the moviePath & "import\" & "StoreDat.TXT"
  191.   else
  192.     set importPath to the moviePath & "import:" & "StoreDat.TXT"
  193.   end if
  194.   if objectp(myFile) then
  195.     set myFile to 0
  196.   end if
  197.   set myFile to new(xtra("fileio"))
  198.   openFile(myFile, importPath, 1)
  199.   set data to readFile(myFile)
  200.   put data into field "storeData"
  201.   put line 21 of field "storeData" into field "sign1"
  202.   put line 22 of field "storeData" into field "sign2"
  203.   put line 23 of field "storeData" into field "sign3"
  204.   put line 24 of field "storeData" into field "sign4"
  205. end
  206.